//Create table
BHBlock = {};

//Called to create a block object, you know OOP stuff
function BHBlock:Create()
	local o = {};
	setmetatable(o, self);
	self.__index = self;
	
	o.Model = "models/props_lab/blastdoor001c.mdl";
	o.File = "";
	o.BlockName = "";
	o.Desc = "";
	o.Team = -1;
	o.Health = 400;
	o.BuildTime = 3;
	o.HackTime = 0;
	o.HackDuration = 20;
	o.PlayerSpawn = true;
	
	return o;
end

//Called when a block is "Hacked"
function BHBlock:Hack(ply) return; end

//Called when a block returns to normal, from "Hacked"
function BHBlock:EndHack() return; end

//Called by ENT:Initialize from the client and server
function BHBlock:Init() return false; end

//Sets a networked int of name to value, and does it appropriatly depending on weather the server calls it or not
function BHBlock:ConVar(name,value)
	if(SERVER) then
		self.SENT.Entity:SetNetworkedInt(name, value);
		return;
	end
	
	if(CLIENT) then
		LocalPlayer():ConCommand("bhserver set " .. self.SENT.Entity:EntIndex() .. " " .. name .. " " .. value .. "\n");
	end
end

//Gets called when the block is removed by either destruction or remove gun
function BHBlock:Removed() return; end

//Gets a networed int
function BHBlock:ConVarGet(name)
	return self.SENT.Entity:GetNetworkedInt(name);
end

//Called on the ENT:Think function
function BHBlock:Think() return; end

//Called during Touch and Collide events
function BHBlock:StartTouch(ent) return; end
function BHBlock:EndTouch(ent) return; end
function BHBlock:Touch(ent) return; end
function BHBlock:Collide(data, phys) return; end

//Return weather a position vec is valid for placement
function BHBlock:ValidPos( vec, err, ply ) return true; end

if(CLIENT) then
	//Sends a server message using a console command
	function BHBlock:SendServerMsg(cmd, arg)
		if(!CLIENT) then return false; end
		
		self.SENT:SendServerMessage(cmd);
	end
	
	//Called when the client requests a CPanel to be drawn
	function BHBlock:DrawCPanel(panel) return false; end
	function BHBlock:Render() return true; end
end